:root {
  --background-dark: #2d3548;
  --text-light: rgba(255, 255, 255, 0.6);
  --text-lighter: rgba(255, 255, 255, 0.9);
  --spacing-s: 8px;
  --spacing-m: 16px;
  --spacing-l: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 64px;
  --width-container: 1200px;
}

html[data-theme="dark"] .hero-section .card__background {
  filter: brightness(0.5) saturate(2) contrast(0.85);
}

html[data-theme="dark"] .hero-section .card:hover,
.card.hover-effect {
  .card__background {
    transform: scale(1.05) translateZ(0);
  }
  .card__heading {
    text-decoration: rgb(255, 255, 255) wavy underline;
  }
}

html[data-theme="dark"]
  .hero-section
  .card-grid:hover
  .card:not(:hover)
  .card__background {
  filter: brightness(0.7) contrast(0.7) blur(2px);
}

.hero-section {
  align-items: flex-start;
  display: flex;
  min-height: 100%;
  justify-content: center;
  padding: var(--spacing-xxl) var(--spacing-l);

  * {
    border: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .card-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-column-gap: var(--spacing-l);
    grid-row-gap: var(--spacing-l);
    max-width: var(--width-container);
    width: 100%;
  }

  @media (min-width: 540px) {
    .card-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 960px) {
    .card-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  .card {
    list-style: none;
    position: relative;
  }

  .card:before {
    content: "";
    display: block;
    padding-bottom: 80%;
    width: 100%;
  }

  .card__background {
    background-size: cover;
    background-position: center;
    border-radius: var(--spacing-l);
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transform-origin: center;
    transform: scale(1) translateZ(0);
    transition:
      filter 200ms linear,
      transform 200ms linear;
  }

  .card__content {
    left: 0;
    padding: var(--spacing-l);
    position: absolute;
    top: 0;

    .text-container {
      padding-top: 1em;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  }

  .card__category {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-s);
    text-transform: uppercase;
  }

  .card__heading {
    color: var(--text-lighter);
    font-size: 1.9rem;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.2);
  }
}
